<?php 
require_once('nav.php'); 
?>
<div class="col-sm-9 col-md-10">
<?php 
$sql = 'select * from videotype';
$result = fetch_array($sql); 
?>
<h1 class="text-center">视频类别列表</h1>
 <table class="table table-hover"> 
 <tr>
   <th>编号</th>
   <th>视频类别</th>   
   <th>操作</th>
 </tr>
 </div>
 </div>
 </div>
 <?php
  foreach ($result as $row) {
   echo '<tr>';
   echo '<td>'.$row['tid'].'</td>';
   echo '<td>'.$row['typename'].'</td>';
   echo '<td><a href="vtedit-form.php?id='.$row['tid'].' ">修改</a> | 
   <a href="vtdelete.php?id='.$row['tid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
   echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";   
 ?>
</div> 
    <?php require_once('footer.php'); ?>